import request from '@/utils/request'

// 查询店铺列表
export function getmerchant(query) {
  return request({
    url: '/merchant/store/page',
    method: 'get',
    params: query
  })
}
// 查询月度账单列表
export function couponAnalysispage(query) {
  return request({
    url: '/merchant/store/couponAnalysis/page',
    method: 'get',
    params: query
  })
}
// 查询月度账单统计
export function couponAnalysis() {
  return request({
    url: '/merchant/couponAnalysis',
    method: 'get'
  })
}
// 新增商家店铺
export function merchantstore(data) {
  return request({
    url: '/merchant/store/add',
    method: 'post',
    data: data
  })
}

// 修改店铺
export function updatemerchant(data) {
  return request({
    url: '/merchant/store/update',
    method: 'put',
    data: data
  })
}

// 删除店铺管理
export function delmerchant(id) {
  return request({
    url: '/merchant/store/delete',
    method: 'delete',
    params:{id:id}
  })
}

// 上传图片
export function uploadPic(data, params) {
  return request({
    url: '/file/upload/image',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    params,
    data
  })
}
export function deleteInventory(inventoryId) {
  return request({
    url: '/supermarket/product/deleteInventory',
    method: 'get',
    params:{
      inventoryId
    }
  })
}
